import type { Component } from "react";
import {
	AutoComplete,
	Cascader,
	Checkbox,
	DatePicker,
	Divider,
	Input,
	InputNumber,
	Radio,
	Rate,
	Select,
	Slider,
	Switch,
	TimePicker,
	TreeSelect
} from "antd";
import ApiSelect from "./components/ApiSelect";
import type { ComponentType } from "./types";
/**
 * Component list, register here to setting it in the form
 */
// import ApiRadioGroup from "./components/ApiRadioGroup";
// import RadioButtonGroup from "./components/RadioButtonGroup";
// import ApiSelect from "./components/ApiSelect";
// import ApiTree from "./components/ApiTree";
// import ApiTreeSelect from "./components/ApiTreeSelect";
// import ApiCascader from "./components/ApiCascader";
// import ApiTransfer from "./components/ApiTransfer";
import FileUpload from "./components/FileUpload";
// import ImageUpload from "./components/ImageUpload";
// import { BasicUpload } from "@/components/Upload";
// import { StrengthMeter } from '@/components/StrengthMeter'
// import { IconPicker } from '@/components/Icon'
// import { CountdownInput } from '@/components/CountDown'
// import { Tinymce } from '@/components/Tinymce'
const componentMap = new Map<ComponentType, any>();
componentMap.set("Input", Input);
componentMap.set("InputGroup", Input.Group);
componentMap.set("InputPassword", Input.Password);
componentMap.set("InputSearch", Input.Search);
componentMap.set("InputTextArea", Input.TextArea);
componentMap.set("InputNumber", InputNumber);
componentMap.set("AutoComplete", AutoComplete);
// componentMap.set("ImageUpload", ImageUpload);
componentMap.set("Select", Select);
componentMap.set("ApiSelect", ApiSelect);
// componentMap.set("ApiTree", ApiTree);
componentMap.set("TreeSelect", TreeSelect);
// componentMap.set("ApiTreeSelect", ApiTreeSelect);
// componentMap.set("ApiRadioGroup", ApiRadioGroup);
componentMap.set("Switch", Switch);
// componentMap.set("RadioButtonGroup", RadioButtonGroup);
componentMap.set("RadioGroup", Radio.Group);
componentMap.set("Checkbox", Checkbox);
componentMap.set("CheckboxGroup", Checkbox.Group);
// componentMap.set("ApiCascader", ApiCascader);
componentMap.set("Cascader", Cascader);
componentMap.set("Slider", Slider);
componentMap.set("Rate", Rate);
// componentMap.set("ApiTransfer", ApiTransfer);

componentMap.set("DatePicker", DatePicker);
componentMap.set("MonthPicker", DatePicker.MonthPicker);
componentMap.set("RangePicker", DatePicker.RangePicker);
componentMap.set("WeekPicker", DatePicker.WeekPicker);
componentMap.set("TimePicker", TimePicker);
// componentMap.set('TimeRangePicker', TimePicker.TimeRangePicker)
// componentMap.set('StrengthMeter', StrengthMeter)
// componentMap.set('IconPicker', IconPicker)
// componentMap.set('InputCountDown', CountdownInput)

// componentMap.set("Upload", BasicUpload);
componentMap.set("FileUpload", FileUpload);
componentMap.set("Divider", Divider);
// componentMap.set('Editor', Tinymce)

export function add(compName: ComponentType, component: Component) {
	componentMap.set(compName, component);
}

export function del(compName: ComponentType) {
	componentMap.delete(compName);
}

export { componentMap };
